Towards putting abstract interpretation of prolog into practice: design, implementation, and evaluation of a tool to verify and optimise prolog programs
نویسنده
چکیده
Logic programming is an attractive paradigm that allows the programmer to concentrate on the meaning (the logic) of the problem to be solved the declarative layer. An execution model is then used as the problem solver the operational layer. In practice, for efficiency reasons, the semantics of the two layers do not always match. For instance, in Prolog, the computation of solutions is based on an incomplete depth-first search rule, unifications and negations may be unsound, some builtin language primitives are not multidirectional, and there exist extralogical features like the cut or dynamic predicates. A large number of work has been realised to reconcile the declarative and operational features of Prolog. Methodologies have been proposed to construct operationally correct and efficient Prolog code. Researchers have designed methods to automate the verification of specific operational properties on which optimisation of logic programs can be based. A few tools have been implemented but there is a lack of a unified framework. The goal and topic of this thesis is the design, implementation, and evaluation of a static analyser of Prolog programs to integrate ‘state-of-the-art’ techniques into a unified abstract interpretation framework. Abstract interpretation is an adequate methodology to design, justify, and combine complex analyses. The analyser that we present in this thesis is based on a non-implemented original proposal. The original framework defines the notion of abstract sequence, which allows one to verify many desirable operational properties of a logic procedure. The properties include verifying type, mode, and sharing of terms, proving termination, sure success or failure, and determinacy of logic procedures, as well as linear relations between the size of input/output terms and the number of solutions to a call. An abstract sequence maintains information about the input and output terms, as well as the non-failure conditions on input terms, and the number of solutions for such inputs. The domains of abstract sequences cooperate together and improve each other. The abstract execution is performed during a single global analysis, and abstract sequences are derived at each program point (the information of the various domains are computed simultaneously). The intended operational properties of a procedure are written in formal specifications. The original framework is an interesting starting point for combining several analyses inside a unified framework. However, it is limited and inaccurate in many ways: it is not implemented, and therefore, it has not been validated by experiments, it accepts only a subset of Prolog (without negation, cut, conditional and
منابع مشابه
Analysis of Pure PROLOG Programs
We deene a new xpoint semantics for pure PROLOG, which is obtained as an instance of the generalized semantics of CLP and is oriented towards abstract interpretation. The semantic domain is composed of sequences of standard and divergent constraints. The semantics is then used as the foundation of a framework for the (bottom-up, goal-independent) abstract interpretation of pure PROLOG programs....
متن کاملOptimizations of Bottom-Up Evaluation with Non-Ground Terms
Bottom-up evaluation of logic programs can be seen as an implementation of memoization. Memoization helps detect loops, avoid repeated computation when subgoals are generated repeatedly, and in conjunction with a fair search strategy, as in bottom-up evaluation, ensures that evaluation is complete. Programs that generate non-ground facts (i.e., facts containing universally quantiied variables) ...
متن کاملAnalyzing Logic Programs Using \ Prop " -
This paper illustrates the role of a class of \prop"-ositional logic programs in the analysis of complex properties of logic programs. Analyses are performed by abstracting Prolog programs to corresponding \prop"-ositional logic programs which approximate the original programs and have nite meanings. We focus on a groundness analysis which is equivalent to that obtained by abstract interpretati...
متن کاملTowards an Efficient Prolog System by Code Introspection
To appear in Theory and Practice of Logic Programming (TPLP). Several Prolog interpreters are based on the Warren Abstract Machine (WAM), an elegant model to compile Prolog programs. In order to improve the performance several strategies have been proposed, such as: optimize the selection of clauses, specialize the unification, global analysis, native code generation and tabling. This paper pro...
متن کاملIgor: a Tool for Developing Prolog Dataaow Analyzers
We describe a tool, Igor, for implementing, testing, modifying, and evaluating abstract domains for analysis of Prolog programs. A high-level speciication language is used for specifying abstract domains that are compiled into Prolog and interfaced with an xpoint engine to make up a complete analyzer. The compiler automatically generates code for basic domain operations from special domain type...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008